﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Medianamik.Core.Interfaces;

namespace Medianamik.Core.ImportExport
{
    public class RecordNodeFactory:INodeFactory<Node>
    {

        private Record _record;

        #region INodeFactory<Node> Members

        public RecordNodeFactory(Record pRecord)
        {
            _record = pRecord;
        }

        public Node GetNode()
        {
            var node = new Node()
            {
                ID = _record.NodeId,
                NodeTypeID = _record.NodeTypeId ,
                ParentID = _record.ParentNodeId,
                //Path = default(string),
                //Depth = default(int?),
                Position = _record.Position,
                //AccessRoles = new RoleCollection(),
                CreatedOn = _record.CreatedOn,
            };

            node.State = EntityStates.Loaded;
            return node;
        }

        #endregion
    }
}
